<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>确认订单</title>
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/suree.css">
	</head>
	<body class="body">
		
		<div class="container-fluid header">	
			<div class="row">
				<div class="col-xs-12" style="border-bottom: 2px solid #DBDBDB;padding: 0px;">
					<div class="col-xs-1" style="padding: 0px;">
						<p class="tu1"><a href="javascript:history.go(-1)"><img src="img/尖括号.png" height="22px"/></a></p>
					</div>
					<div class="col-xs-1" style="padding: 0px;">
						<p class="tu2"><a href=""><img src="img/关闭.png" height="22px"></a></p>
					</div>
					<div class="col-xs-10" style="padding: 0px;">
						<p class="house">确认订单</p>
					</div>
					
				</div>
			</div>
		</div>

		<form action="ShopwapPayServlet" method="post">

			<input type="hidden" value="${user.userId}" class="userId" name="userId"/>
			<input type="hidden" value="" class="random" name="orderNum"/>
			<input type="hidden" value="${addressId}"  name="addressId"/>
			<input type="hidden" value="${shopa.id}"  name="shopId"/>
			<input type="hidden" value="" class="orderUme"  name="orderUme"/>
			<input type="hidden" value="${address.addressPhone}" name="rPhone"/>
			<input type="hidden" value="" class="orderPrice" name="orderPrice" id="orderPrice"/>
			<input type="hidden" value="" class="alipayNum" name="alipayNum"/>
			<input type="hidden" value="" class="orderTime" name="orderTime"/>

			<div class="dizhi1" style="height: 132px">
				<input type="hidden" value="${address.address}" id="getdizhi"/>
				<p id="dizhisan"></p>
				<p id="dididi" style="position: relative;">
					<a href="orderaddress?id=${shopa.id}" class="xindizhi" id="dizhier" style="height: 30px;display: inline-block;width: 100%;"></a>
					<span class="youyou"><img src="img/kuohao.png" width="16px"/></span>
				</p>
				<p>${address.addressPeople}   ${address.addressPhone}</p>
				<hr style="padding: 0px;margin:10px 0px;" />
				<p class="peisong">配送方式<span>快递</span></p>
			</div>

			<div class="dinpu1" style="height: 212px;">
				<p><img src="img/商城.png" width="20px"/>&nbsp;邻里邦</p>
				<div>
					<img src="img/${shopa.shopImg}" width="105px" style=""/>
					<p class="shoptitle" style="">${shopa.shopName}</p>
					<p class="num" style="">￥<strong class="price">${shopa.shopPrice}</strong><span style="float: right;">x<lable class="numa"></lable></span></p>
					<p style="width: 100%;text-align:right;color:#A2A2A2 ;font-size: 16px;margin-top:25px;">共<span class="jijian"></span>件<span style="margin-left: 15px;color: black;font-size: 18px;">商品小计：<span style="color: #FE4543;" class="totalPrice"></span></span></p>
				</div>
			</div>
			
			
			<p class="youhuiquan">优惠券<span>暂无可用&nbsp;<img src="img/kuohao.png" width="16px"/></span></p>
			<p class="youhuiquan">余额/卡<span>暂无可用&nbsp;<img src="img/kuohao.png" width="16px"/></span></p>
			<p class="youhuiquan">买家留言<input type="text" placeholder="留言建议提前协商（50字以内）" style="width: 76%;"/></p>


			
			
			<div style="width: 100%;background-color: white;height:60px;line-height: 60px;position: fixed;bottom: 0px;padding: 0px 25px;font-size: 18px;">
				<p>应付：<span style="color:#FE4543;" class="totalPrice"></span>
				<button style="height:50px;line-height:40px;font-size:16px;width:125px;border-radius:20px;float:right;margin-top:10px;border: none;outline: none;background-color: #FE4543;color: white;height: 40px;">提交订单</button></p>
			</div>
		</form>

		<script type="text/javascript" src="js/jquery-3.2.1.js" ></script>
		<script>
			function totalPrice() {
				var numa= localStorage.getItem("numm");
				$(".numa").text(numa);
				$(".jijian").text(numa);
				$(".orderUme").val(numa);
				var price = $(".price").text();
				var totalPrice = parseInt(numa)*parseInt(price);
				$(".totalPrice").text("￥"+totalPrice);
				$(".orderPrice").val(totalPrice);
			}
			totalPrice();


			function getForm(){
				var getdizhiStr = $("#getdizhi").val(); //数据库获取的值
				var getdizhi = new Array();
				if(getdizhiStr !=null || getdizhiStr !=""){
					getdizhi = getdizhiStr.split(",");
					$("#dizhisan").text(getdizhi[0]);
					$("#dizhier").text(getdizhi[1]);
				}
			}

			getForm();

		</script>
		<script>

			// digit是数字的位数
			function runStr(digit){
				if(digit=="" || isNaN(digit)){
					alert("请输入数字");
				}else{
					var sourceStr="0,1,2,3,4,5,6,7,8,9";
					arrStr=sourceStr.split(",");
					var result=""; //定义变量并初始化
					var index=0;
					for(i=0;i<digit;i++){
						index=parseInt(Math.random()*arrStr.length);
						result+=arrStr[index];
					}
					$(".random").val(result);
				}

			}
			runStr(9);

			function zhifubao(digit){
				if(digit=="" || isNaN(digit)){
					alert("请输入数字");
				}else{
					var sourceStr="0,1,2,3,4,5,6,7,8,9";
					arrStr=sourceStr.split(",");
					var result=""; //定义变量并初始化
					var index=0;
					for(i=0;i<digit;i++){
						index=parseInt(Math.random()*arrStr.length);
						result+=arrStr[index];
					}
					$(".alipayNum").val(result);
				}
				var date = new Date();
				var year = date.getFullYear();
				var month = date.getMonth()+1;
				var day = date.getDate();
				var orderTime =year+"-"+month+"-"+day;
				$(".orderTime").val(orderTime);

			}

			zhifubao(11);
		</script>

	</body>
</html>
